<?php
$table = $this->uri->segment(3,0);
$url_ajax = base_url().'admin/ajax_field/order';
$url_ajax_sotrang = base_url().'admin/ajax_field/num';
$url_ajax_pub = base_url().'admin/ajax_field/pub/'.$table;
$url_ajax_where = base_url().'admin/ajax_field/where/'.$table;
?>
<div id="main-content">
    <div class="container">
    	<div class="row">
    		<div id="content" class="col-lg-12">
    			<!-- PAGE HEADER-->
                    <div class="row">
							<div class="col-sm-12">
								<div class="page-header">
									<div class="clearfix">
										<h3 class="content-title pull-left">Chỉnh sửa giới thiệu</h3>
									</div>
								</div>
							</div>
                            <?php if(!empty($data)) { ?>
                            <?php foreach ($data as $d) :  ?>
                            <div class="col-md-6 box-container ui-sortable">
                               <div class="box border" style="opacity: 1; z-index: 0;">
									<div class="box-title">
										<h4><i class="fa fa-reorder"></i><?php echo character_limiter($d->title,50); ?></h4>
										<div class="tools">
											<a href="<?php echo base_url().'admin/xuly/intro_index/edit/'.$d->id ?>" data-toggle="modal" class="config">
												<i class="fa fa-edit"></i>
											</a>
											<a href="javascript:;" class="collapse">
												<i class="fa fa-chevron-up"></i>
											</a>
											<a href="javascript:;" class="remove">
												<i class="fa fa-times"></i>
											</a>
										</div>
									</div>
									<div class="box-body" style="min-height: 200px;">
                                        <?php echo character_limiter($d->description,600); ?>
                                        <br />
                                        <a href="<?php echo base_url().'admin/xuly/intro_index/edit/'.$d->id ?>" title="Chỉnh sửa bài viết" ><i class="fa fa-edit"></i>&nbsp;&nbsp;&nbsp;Chỉnh sửa bài viết</a>
									</div>
								</div>
					       </div>
                           <?php endforeach; }
                           else { echo 
                                       '<div class="col-sm-12"><div class="panel panel-danger">
                                            <div class="panel-heading">
                                              <h3 class="panel-title">Cập nhật bài viết</h3>
                                            </div>
                                            <div class="panel-body">
                                              <h4>Hiện tại chưa có dữ liệu cho trang web vui lòng cập nhật dữ liệu !</h4>
                                            </div>
                                        </div></div>'; } ?>
                                        <div class="clearfix"></div>
							<div class="col-sm-12">
										<a href="<?php echo base_url().'admin/xuly/intro_index/edit'; ?>" title="Thêm mới" class="btn btn-info">Thêm mới</a>
							</div>
  			</div>
    			<!-- /PAGE HEADER -->
    		</div>
    	</div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url().'skin/admin/' ?>js/jQuery-slimScroll-1.3.0/jquery.slimscroll.min.js"></script>
<script>
		jQuery(document).ready(function() {		
			App.setPage("widgets_box");  //Set current page
			App.init(); //Initialise plugins and elements
		});
</script>